namespace Digitalmes.Common.Workflows;

public sealed record WorkflowFunctionTargetBuilder
{
    public WorkflowStepBuilder Step { get; init; }

    public string FunctionName { get; init; }

    public string? ParameterName { get; init; }

    /// <summary>
    /// The unique identifier for the event to target. This may be null if the target is not a sub-process.
    /// </summary>
    public string? TargetEventId { get; init; }

    public WorkflowFunctionTargetBuilder(WorkflowStepBuilder step, string? functionName = null, string? parameterName = null)
    {
        //Step = step;

        //if (step is WorkflowEndStep)
        //{
        //    FunctionName = "END";
        //    ParameterName = null;
        //    return;
        //}

        throw new NotImplementedException();
    }

    internal WorkflowFunctionTarget Build()
    {
        return new WorkflowFunctionTarget(Step.Id, FunctionName, ParameterName, TargetEventId);
    }
}
